#pragma once
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <iostream>
#define CONV(v) (struct sockaddr *)(v)
#define Die(code) do{exit(code);} while(0);

bool SplitString(const std::string &line,std::string *key,std::string *value,const std::string &sep)
{
    auto pos=line.find(sep);
    if(pos==std::string::npos) return false;
    *value=line.substr(0,pos);
    *key=line.substr(pos+sep.size());
    if(key->empty()||value->empty())
    {
        return false;
    }
    return true;
}